<?php


namespace App\Traits\Model;


use Illuminate\Database\Eloquent\Builder;

trait OrderByIdDesc
{
    protected static function boot()
    {
        static::addGlobalScope('orderBy', function (Builder $query){
            $query->orderByDesc('id');
        });
        parent::boot();
    }
}
